package com.leyou.auth.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//- 2.把OSS的客户端抽取并注入spring
@Configuration
public class OssConfig {
    @Bean
    public OSS ossClient(OssProperties properties) {
        return new OSSClientBuilder().build(properties.getEndpoint()
                , properties.getAccessKeyId()
                , properties.getAccessKeySecret());
    }
}
